from django.db import models

class Clazz(models.Model):
    cname = models.CharField(max_length=30)

    def __str__(self):
        return 'Clazz:%s'%self.cname

    class Meta():
        db_table = 'clazz'

class Student(models.Model):
    sname = models.CharField(max_length=30)
    clazz = models.ForeignKey(Clazz,on_delete=models.CASCADE)

    def __str__(self):
        return 'Student:%s' % self.sname

    class Meta():
        db_table = 'student'

class User(models.Model):
    username = models.CharField(max_length=40)
    password = models.CharField(max_length=40)

    class Meta():
        db_table = 'user'